package com.itheima.demo7_实现多态.继承时多态_2;

abstract class Animal {
    public abstract void eat();
}

class Dog extends Animal {
    @Override
    public void eat() {
        System.out.println("狗吃骨头....");
    }
}

class Cat extends Animal {
    @Override
    public void eat() {
        System.out.println("猫吃鱼.....");
    }
}


public class Test_2 {
    public static void main(String[] args) {
        Animal anl1 = new Dog();
        anl1.eat();
        Animal anl2 = new Cat();
        anl2.eat();
    }
}
